System, method, and computer program product for optimization of a scene graph

ABSTRACT

The invention described herein is a system, method, and computer program product for optimization of a scene graph. The system includes an optimization base that contains a set of specific atomic optimizations. The system also includes an optimization registry that lists each atomic optimization, parameters associated with each optimization, and priority information relating to the necessary order in which optimizations must be performed. The system also includes an optimization manager which creates, configures, and applies an optimization process to an input scene graph. The system further includes an optimization configuration module for accepting user input to the optimization process. The method includes the steps of receiving an input scene graph, creating the optimization process, applying the optimization process to the input scene graph, and post-optimization processing. The optimization process can be performed for any of a number of purposes, such as the enhancement of scene graph traversal time, the enhancement of drawing time, the reduction of memory usage, improved efficiency of data manipulation, and the targeting of a specific rendering platform.

CROSS-REFERENCE TO RELATED APPLICATIONS

Not applicable.

STATEMENT REGARDING FEDERALLY-SPONSORED RESEARCH AND DEVELOPMENT

Not applicable.

REFERENCE TO MICROFICHE APPENDIX/COMPUTER PROGRAM LISTING APPENDIX

Not applicable.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention described herein relates to computer graphics, and moreparticularly to data representation and rendering.

2. Background Art

In computer graphics, a scene can be modeled in a variety of ways. Oneway is through the use of a scene graph. The nodes of a scene graphrepresent features of the scene, such as physical objects and theirattributes (e.g., colors and textures). The edges of a scene graphrepresent associations between the connected nodes. A node representingan object, for example, may be connected to a node representing atexture for that object. Scene graphs are often represented in objectoriented languages such as C++. Scene graphs are well known in thecomputer graphics field, and are described in greater detail in “TheInventor Mentor” by Josie Wemecke, published by Addison Wesley,incorporated herein by reference in its entirety. An example of a scenegraph is shown in FIG. 1. Scene graph 100 represents a house. The houseis identified with root node 110. The house includes a number ofcomponents, such as door 120, roof 130, and aggregate walls 140.Individual walls 150 through 180 are associated with aggregate walls140. Each wall can have some number of attributes. For example, wall 180is shown having texture 190.

Scene graphs can be produced by a modeler. A modeler can be a person ora program that converts a scene into one or more scene graphs. A numberof modelers are available commercially, such as MAX and MAYA.Ultimately, a scene graph is rendered to produce an image. This isillustrated generally in FIG. 2. Here, a modeler 210 a produces a scenegraph that is processed through an export library 220 a. Export library220 a manipulates the scene graph to put it in a form that can berendered by rendering platform 240. Export library 220 a may include anoptimizer 230 a that further revises the scene graph in order tooptimize the graph in some manner prior to rendering. Optimizer 230 amay, for example, manipulate the scene graph so as to minimize thememory requirements during rendering, or improve the drawing time.

As shown in FIG. 2, however, a rendering platform may have toaccommodate scene graphs produced by a variety of modelers. Suchmodelers are illustrated in FIG. 2 as modelers 210 a, 210 b and 210 c.Each modeler sends its scene graphs to rendering platform 240, viaexport libraries 220 a, 220 b, and 220 c, respectively. As discussedabove, each export library may include an optimizer. The optimizers forthe respective export libraries are shown as optimizers 230 a, 230 b,and 230 c, respectively.

The arrangement of FIG. 2 is inherently redundant and inefficient. Theexport libraries and their optimizers perform analogous functions. Thecode representing software embodiments of the export libraries andoptimizers is therefore repetitive. Hence, there is a need for a commonexport library and, in particular, a common optimizer that can processthe scene graphs produced by a variety of modelers such that theresulting scene graphs are tailored to a particular rendering platform.

BRIEF SUMMARY OF THE INVENTION

The invention described herein is a system, method, and computer programproduct for optimization of a scene graph. The system of the inventionincludes an optimization base that contains a set of specific atomicoptimizations. The system also includes an optimization registry thatlists each atomic optimization, parameters associated with eachoptimization, and priority information relating to the necessary orderin which optimizations must be performed. The system also includes anoptimization manager which creates, configures, and applies anoptimization process to an input scene graph. The system furtherincludes an optimization configuration module for accepting user inputto the optimization process.

The method of the invention includes the steps of receiving an inputscene graph, creating the optimization process, applying theoptimization process to the input scene graph, and post-optimizationprocessing. The optimization process can be performed for any of anumber of purposes, such as the enhancement of scene graph traversaltime, the enhancement of drawing time, the reduction of memory usage,improved efficiency of data manipulation, and the targeting of aspecific rendering platform.

The foregoing and other features and advantages of the invention will beapparent from the following, more particular description of a preferredembodiment of the invention, as illustrated in the accompanyingdrawings.

BRIEF DESCRIPTION OF THE DRAWINGS/FIGURES

FIG. 1 illustrates an example of a scene graph.

FIG. 2 illustrates the functional relationship between multiplemodelers, their export libraries, and a rendering platform.

FIG. 3 illustrates the overall structural context of the inventiondescribed herein.

FIG. 4 illustrates the structure of a scene graph optimizer, accordingto an embodiment of the invention.

FIG. 5 illustrates the computing environment of the invention, accordingto an embodiment.

FIG. 6 illustrates the overall method of the invention.

FIG. 7 illustrates the method of creating an optimization process,according to an embodiment of the invention.

FIG. 8 illustrates post optimization processing, according to anembodiment of the invention.

FIG. 9 illustrates an application of the collapse geometry optimization.

FIG. 10 illustrates an example of the collapsed hierarchy optimization.

FIG. 11 illustrates a further application of the collapsed hierarchyoptimization.

FIG. 12 illustrates an application of the flattened hierarchyoptimization.

FIG. 13 illustrates an application of the generate macro textureoptimization.

FIG. 14 illustrates an application of the promote attributesoptimization.

DETAILED DESCRIPTION OF THE INVENTION

A preferred embodiment of the present invention is now described withreference to the figures, where like reference numbers indicateidentical or functionally similar elements. Also in the figures, theleft-most digit of each reference number corresponds to the figure inwhich the reference number is first used. While specific configurationsand arrangements are discussed, it should be understood that this isdone for illustrative purposes only. A person skilled in the relevantart will recognize that other configurations and arrangements can beused without departing from the spirit and scope of the invention. Itwill be apparent to a person skilled in the relevant art that thisinvention can also be employed in a variety of other devices andapplications.

Table of Contents

-   I. Overview-   II. System-   III. Process-   IV. Atomic Optimizations

A. Collapse Geometry

B. Collapse Hierarchy

C. Convert Image

D. Convert Transform

E. Create Bounding Boxes

F. Flatten Hierarchy

G. Generate Macro Texture

H. Normalize Texture Coordinates

I. Promote Attributes

J. Remove Attributes

K. Resize Image

L. Share Attributes

M. Spatial Partition

N. Strip Triangles

O. Transform Alpha

P. Vertex Blending

-   V. Conclusion    I. Overview

The invention described herein represents a system, method, and computerprogram product for optimization of a scene graph, where theoptimization is performed for any of a variety of purposes. Theoptimization can be performed so as to improve the drawing time of therenderer, improve the time required to traverse the scene graph, adjustthe memory requirements of the renderer, improve the efficiency of thedata manipulation during rendering, and/or to target the resulting scenegraph to a particular rendering platform. The optimizer can be used witha variety of modelers and can produce a scene graph tailored to aspecific rendering platform.

The invention described herein is a system, method, and computer programproduct for optimization of a scene graph. The system of the inventionincludes an optimization base that contains logic representing a set ofspecific atomic optimizations. An atomic optimization is an algorithmfor optimizing a scene graph. Such an algorithm can be implemented withsoftware or hardware logic, or a combination of the two. The system alsoincludes an optimization registry that lists the atomic optimizations.The optimization registry also includes parameters associated with eachoptimization and priority information relating to the necessary order inwhich optimizations must be performed. The system also includes anoptimization manager that creates, configures, and applies anoptimization process to an input scene graph. The system furtherincludes an optimization configuration module for accepting user inputto the optimization process.

The method of the invention includes the steps of receiving an inputscene graph, creating the optimization process, applying theoptimization process to the input scene graph, and post-optimizationprocessing. The optimization process can be performed for a number ofpurposes, such as the enhancement of scene graph traversal time, theenhancement of drawing time, the reduction of memory usage, improvedefficiency of data manipulation, and/or the targeting of a specificrendering platform.

II. System

The system of the invention optimizes an input scene graph to produce anoptimized scene graph which can then be rendered. The context in whichthe optimizer functions is illustrated in FIG. 3. A modeler 310 acreates a scene graph 315 a and passes it to a common export library320. The scene graph exported from library 320 is then passed tooptimizer 330. The exported scene graph is an input scene graph 325 foroptimizer 330. Optimizer 330 then creates an optimized scene graph 335,which is sent to rendering platform 340. Library 320 and optimizer 330can function with a variety of modelers, as shown. Like modeler 310 a,modelers 310 b and 310 c can also create scene graphs that are sent tooptimizer 330 via common export library 320.

Optimizer 330 is shown in greater detail in FIG. 4, according to anembodiment of the invention. An input scene graph 325 is received by anoptimization manager 440. Optimization manager 440 creates anoptimization process based on a specific atomic optimization. The atomicoptimization can be identified by a user, or a default optimization canbe used. Optimization manager 440 also configures the atomicoptimization. The configuration can be based on user input, or can bebased on default configuration values. Optimization manager 440 thenapplies the optimization process to input scene graph 405, to produce anoptimized graph 435.

In the illustrated embodiment, the selection of a specific atomicoptimization is made by user 410. User 410 supplies user configurationinformation 415 to optimization manager 440 via a configuration manager420. The set of available atomic optimizations is contained in anoptimization base 425. A list of the available atomic optimizations ismaintained in an optimization registry 430, along with informationpertinent to the execution of the specific atomic optimizations. Thisinformation can include, for example, the parameters required by anatomic optimization, and any priority information that defines thesequence in which specific atomic optimizations can or should beapplied. Given the choice of a specific atomic optimization identifiedin user configuration information 415, optimization manager 440associates input scene graph 405 with the identified atomic optimizationin optimization base 425, via optimization registry 430. Userconfiguration information 415 can also include configurationinformation, e.g., parameters that must be defined for a given atomicoptimization. In an embodiment of the invention, user configurationinformation 415 is supplied to configuration information manager 420 inthe form of a text file. In an alternative embodiment of the invention,a user interface is supplied to user 410 allowing user 410 to identify,to configuration manager 420, selected atomic optimizations andparameters.

Note that optimization manager 440, configuration manager 420,optimization base 425, and optimization registry 430 can be implementedin hardware or software or any combination thereof. In an embodiment ofthe invention, these components are implemented using an object orientedlanguage.

In an alterative embodiment of the invention (not shown), optimizer 330and export library 320 can be integrated into a modeler, such as modeler310 a, such that modeling and optimization are combined in a singlemodule. Alternatively, these components can be organized as illustratedin FIG. 3, but controlled through a user interface of the modeler, e.g.,modeler 310 a. In this arrangement, the user of the modeler controlsboth the modeling and optimization processes. Referring to FIG. 4, userconfiguration information 415 would be supplied to optimizer 330 throughsuch a user interface.

Some of the specific atomic optimizations that can be used in theinvention are discussed below in Section IV. The optimizations describedtherein are not meant to be limiting. Rather, the identifiedoptimizations are meant to serve as examples of optimizations that canbe used in the invention. Other optimizations not identified in SectionIV can also be used within the scope of the invention described herein.

Referring again to FIG. 3, optimizer 330 may be implemented usinghardware, software or a combination thereof. In particular, optimizer330 may be implemented using an object-oriented approach, and execute ona computer system or other processing system. An example of such acomputer system 500 is shown in FIG. 5. The computer system 500 includesone or more processors, such as processor 504. The processor 504 isconnected to a communication infrastructure 506 (e.g., a bus ornetwork). Various software embodiments can be described in terms of thisexemplary computer system. After reading this description, it willbecome apparent to a person skilled in the relevant art how to implementthe invention using other computer systems and/or computerarchitectures.

Computer system 500 also includes a main memory 508, preferably randomaccess memory (RAM), and may also include a secondary memory 510. Thesecondary memory 510 may include, for example, a hard disk drive 512and/or a removable storage drive 514, representing a magnetic tapedrive, an optical disk drive, etc. The removable storage drive 514 readsfrom and/or writes to a removable storage unit 518 in a well knownmanner. Removable storage unit 518 represents a magnetic tape, opticaldisk, etc. As will be appreciated, the removable storage unit 518includes a computer usable storage medium having stored therein computersoftware and/or data.

Secondary memory 510 can also include other similar means for allowingcomputer programs or input data to be loaded into computer system 500.Such means may include, for example, a removable storage unit 522 and aninterface 520. Examples of such means also include a program cartridgeand cartridge interface (such as that found in video game devices), aremovable memory chip (such as an EPROM, or PROM) and associated socket,and other removable storage units 522 and interfaces 520 which allowsoftware and data to be transferred from the removable storage unit 522to computer system 500.

Computer system 500 may also include a communications interface 524.Communications interface 524 allows software and data to be transferredbetween computer system 500 and external devices. Examples ofcommunications interface 524 may include a modem, a network interface(such as an Ethernet card), a communications port, a PCMCIA slot andcard, etc. Software and data transferred via communications interface524 are in the form of signals 528 which may be electronic,electromagnetic, optical or other signals capable of being received bycommunications interface 524. These signals 528 are provided tocommunications interface 524 via a communications path (i.e., channel)526. This channel 526 carries signals 528 into and out of computersystem 500, and may be implemented using wire or cable, fiber optics, aphone line, a cellular phone link, an RF link and other communicationschannels. In an embodiment of the invention, signals 528 can conveyinformation required by the optimizer 330, such as input scene graph 325and user configuration information 415. Signals 528 can also conveyoptimized scene graph 435 to a graphics platform for rendering.

In this document, the terms “computer program medium” and “computerusable medium” are used to generally refer to media such as removablestorage drive 514, a hard disk installed in hard disk drive 512, andsignals 528. These computer program products are means for providingsoftware to computer system 500. The invention is directed in part tosuch computer program products.

Computer programs (also called computer control logic) are stored inmain memory 508 and/or secondary memory 510. Computer programs may alsobe received via communications interface 524. Such computer programs,when executed, enable the computer system 500 to perform the features ofthe present invention as discussed herein. In particular, the computerprograms, when executed, enable the processor 504 to perform thefeatures of the present invention. Accordingly, such computer programsrepresent controllers of the computer system 500.

III. Process

The process of the invention includes receipt of an input scene graph,creation of an optimization process that may be based on user input, andapplication of the optimization process to create an optimized scenegraph. This process is illustrated generally in FIG. 6. The processbegins at step 610. In step 620, an input scene graph is received by theoptimization manager. In step 630, an optimization process is created bythe optimization manager, based on one or more specific atomicoptimizations available, selection of one or more specific atomicoptimizations by a user, and other user inputs. The optimization processembodies the selected atomic optimization, configured according to anyuser input and/or default configuration parameters. In step 640, theoptimization manager applies the optimization process to the input scenegraph. This results in the creation of an optimized scene graph. In step650, post optimization processing is performed. As will be describedbelow, post optimization processing includes the performance of validitychecks on the optimized scene graph, and the collection and display ofstatistics relating to the performance of the optimization process.

In step 660, a determination is made as to whether further optimizationis required. Such further optimization may be requested by the user, forexample. If so, then the process continues at step 630, where a newoptimization process is created. If, in step 660, no furtheroptimization is required, then the process concludes at step 670. Theprocess of FIG. 6 can therefore operate iteratively. The user canspecify a specific atomic optimization, which is then performed; theuser can then specify another atomic optimization (or repeat the firstone), which is likewise performed. This can continue until the resultingscene graph has the properties desired by the user. Moreover, thisallows the user to tailor the result to particular needs, e.g., to aparticular rendering platform.

Step 630 above, the creation of an optimization process, is illustratedin greater detail in FIG. 7. This process begins at step 705. In step710, the optimization manager receives input from a user regarding aspecific atomic optimization to be used, along with any parameters thatthe user elects to specify. As described above, the optimization managerreceives the user configuration information via a configuration manager.In step 715, the optimization manager accesses a specific atomicoptimization through an optimization registry. In step 720, theconfiguration information received in step 710 is associated with theoptimization process.

In step 725, a determination is made as to whether the user hasidentified a parameter for the optimization. If so, then in step 730,the optimization is configured according to the user identifiedparameters. If, in step 725, there is no user identified parameter, thenin step 735 the optimization is configured using a default parameter. Instep 740, a determination is made as to whether there are any additionalparameters required by the optimization. If so, then the processcontinues at step 725, where a determination is made as to whether theuser has identified the parameter. If, in step 740, there are noadditional parameters needed, then the process concludes at step 750.

In step 640 above, an optimization process, based on one or morespecific atomic optimizations, is applied to an input scene graph. Theprocessing associated with several specific atomic optimizations isdescribed below in section IV.

Step 650 above, post-optimization processing, is illustrated in greaterdetail in FIG. 8. The process begins with step 810. In step 820,validity checks are performed on the optimized scene graph produced instep 640 above. Here, the optimized scene graph is analyzed for a numberof possible conditions that represent errors in the graph. For example,if a group has a child node that does not reference the group as theparent, this represents an error condition. Also, if a child has aparent that does not reference the child as such, this too represents anerror condition. If a child references a parent not in the graph, thenthis too is an error condition. If possible, these errors are alsorepaired in step 820.

In an embodiment of the invention, step 830 includes the creation ofstatistics based on the just-completed optimization process. Suchstatistics may include, for example, the number of nodes eliminated, thenumber of nodes remaining, and the depth of the resulting optimizedscene graph. In step 840, the statistics and actions related to theoptimization process are output. Actions may include, for example, thename of the atomic optimization that was performed, and any errorconditions uncovered in step 820 above. In an embodiment of theinvention, the output can be directed to memory so that a log ismaintained for the optimization process. In an alternative embodiment,the information of step 840 is output to a display or other outputdevice for the user's benefit. The process concludes at step 850.

IV. Atomic Optimizations

This section describes a set of specific atomic optimizations that canbe used in the invention. This list is not intended to be comprehensiveor in any way a limitation of the invention. Rather, these optimizationsare presented as examples.

A. Collapse Geometry

This optimization gathers geometries that are in the same state tocreate an aggregate node. In particular, the input scene graph istraversed and, for each node, a determination is made as to whether thesubtree consists of geometry. If so, the geometries of the subtree arecombined. This is illustrated in FIG. 9. The input scene graph includesa root node 910 that corresponds to the walls of a building. Associatedwith node 910 is a texture node 920. Subordinate to node 920 are threegeometry nodes, 930, 940 and 950. With this optimization, the geometrynodes are gathered and collectively replaced by geometry 980 in theoptimized scene graph. In the collapse geometry scene graphoptimization, the user can specify a common format for the vertex arrayof the resulting geometry. This format specification represents a userinput for the optimization.

Because the number of nodes is reduced, memory usage is reduced. Also,if all the geometries are to be drawn, drawing time will be reducedbecause there will be fewer function calls.

B. Collapse Hierarchy

This optimization looks for patterns in a scene graph that would allowthe deletion of nodes, so as to collapse the hierarchy. For example, agroup having a single child can be transformed to a subgraph containingjust the child. This is illustrated in FIG. 10. A group 1010 is shownhaving a single child 1020. Application of this transformation leads toreplacement of this subgraph with the single child node 1020.

In another example, a geometry transform node is applied to a geometry,resulting in a transformed geometry and deletion of the transform node.This is illustrated in FIG. 11. Here a child node 1110 is followed by atransform node 1120 which, in turn, is followed by a geometry node 1130.In this optimization, the transform identified in node 1120 is appliedto geometry 1130. This results in a new graph featuring child node 1110followed by transformed geometry node 1140. This effectivelypre-computes the transformation during the optimization process. Inother examples of the collapsed hierarch optimization, empty attributesets can be replaced by a single group node, and empty geometries cansimply be deleted.

In general, the collapse hierarchy optimization has the benefit ofenhancing the traversal time of a scene graph, and also reduces thememory usage associated with the scene graph by reducing the number ofnodes.

C. Convert Image

This optimization converts an image to a pixel format specified by theuser. The new format can be associated with a predetermined indexedcolor table, or can be a format using a different number of bits forcolor coordinates, e.g., 16, 24, or 32 bits. This optimization can beused to target a specific rendering platform. This has the potential toallow faster drawing and to reduce memory usage, depending on thespecified format.

D. Convert Transform

This optimization pertains to animation. Animation involves a series ofkey frames and integration between the frames. The convert transformoptimization replaces the integration (i.e., the transformation) thatappears in a scene graph. The transformation is replaced by a fastertransformation. In an embodiment of the invention, the fastertransformation is specified by the user as an input.

For example, given a transformation node for a global-to-local mappinginvolving a dynamic matrix, a spline-based interpolation can be replacedby a linear interpolation. Such a convert transform optimization reducesthe traversal time by reducing the matrix interpolation cost. Inaddition, memory usage is reduced.

Also, this optimization can include analysis of whether there is anychange in the position of an element of a frame. If not, there is noneed for interpolation for the element, and no need to create a fullchannel for it. This analysis can influence the choice of integrationmethod.

E. Create Bounding Boxes

As the name implies, this optimization creates bounding boxes for allnodes of the input scene graph. The bounding boxes are necessary for anyview frustum culling algorithm. After creation of the bounding boxes,the unnecessary bounding boxes are removed. This optimization takes thecreation of bounding boxes out of run time and performs the operationduring optimization instead. This optimization increases memory usagedue to the creation of the bounding volumes. However, traversal time isreduced.

F. Flatten Hierarchy

This optimization takes an input scene graph and converts it to a scenegraph having a more uniform depth. In a modeler, an artist may specify ahierarchy that reflects the artist's manipulations, or the artist'ssteps in creation of the scene and its objects. However, there may be noneed to use that specific hierarchy at run time. In light of this, itcan be preferable to replace the hierarchy. The goal of thisoptimization is to create a hierarchy that is more amenable to othersubsequent optimizations. An example of this optimization is shown inFIG. 12. In this example, a group node 1210 has a subordinate group node1220 and a geometry 1230. Group node 1220 is in turn associated with twogeometry nodes, 1240 and 1250. After applying the optimization, groupnode 1220 is removed so that geometry nodes 1230 through 1250 are alldirectly subordinate to group node 1210.

G. Generate Macro Texture

This optimization addresses the problem of a single object that usesmore than one texture. The optimization generates a single texturecomposed of the individual component textures. In an embodiment of theinvention, the texture coordinates are changed to use a new texturecoordinate space. This is illustrated in FIG. 13. A single object, shownas group node 1310 has two associated textures, shown as texture nodes1320 and 1330. Each of the texture nodes has an associated geometrynode, geometry nodes 1325 and 1335 respectively.

This graph is transformed such that group node 1310 now has a singletexture node 1340. Texture node 1340 represents a combination of the twotextures 1320 and 1330. In this illustration, the two geometry nodes1325 and 1335 are also combined to form a geometry node 1350. Thisavoids the alternative of having to split the original object intosubmeshes that each use different textures. In an embodiment of theinvention, a bin packing algorithm is used to organize the textures in atexture page. The texture coordinates of the geometries that are usingthe texture are remapped to fit the generated texture page. On someplatforms, a subregion texturing mode can be used to integrate textureswhich are repeated over triangles.

H. Normalize Texture Coordinates

This optimization reduces the absolute values of texture coordinates.Texture coordinates, used in the mapping of textures onto triangles, donot have a unique representation. Whenever a texture is repeated over atriangle, the integer part of a texture coordinate increases by thenumber of repeats. This leads to texture coordinates with values such as12.3 or 14.2. It is equivalent to use values corresponding to these,such as 2.3 and 4.2. A problem arises because some rendering platformslimit the absolute value of a texture coordinate. Values that exceedthis limit can create register overflows and values may be clamped,distorting the texture. In addition, if a texture is repeated too oftenover a triangle, then the mapping may lose precision. This optimization,therefore, reduces the absolute value of texture coordinates, andtessellates a triangle if a texture coordinate becomes too great as aresult of repeating the texture over a triangle.

If triangles are created during the tessellation process, more memorywill be used and the drawing time will increase. However, the drawingquality will improve.

I. Promote Attributes

Some scene graphs, such as those used by INTRINSIC GRAPHICS' ALCHEMYplatform, version 1.0, available from INTRINSIC GRAPHICS of MountainView, Calif., incorporate the concept of state inheritance. Once anattribute is declared, the attribute is used by all the subordinateattributes unless the attribute is redefined. The traversal of a scenegraph is typically performed using a stack data structure. Attributesthat are encountered traveling down a graph are pushed on to the stack;when returning up the graph, the encountered attributes, previouslypushed, are then popped. Traversal is therefore faster if fewerattributes need to be pushed onto the stack. Moreover, drawing can takeplace faster.

This optimization reduces the number of pushes by promoting attributesto higher tiers in the scene graph, given that such attributes aredeclared identically in sub-branches. An example of this optimization isillustrated in FIG. 14. A group attribute 1410 is associated with twosubordinate attribute attributes, 1420 a and 1420 b. Subordinate toattribute 1420 a is subgraph 1430; subordinate to attribute 1420 b issubgraph 1440. If attribute 1420 a is identical to attribute 1420 b,then this optimization can be applied so that attributes 1420 a and 1420b are consolidated into a single attribute 1420.

In general, this optimization examines all child attributes, and findsall the child attributes that are in the same state. These children canbe considered as “found” attributes. A new attribute is then createdcorresponding to this state. Copies of all the found attributes areappended to this created attribute as children. Wherever the attributeis defined in a branch that is instantiated such that there is anotherpath which leads to that branch, then a new node defining this attributeis defined for all the other paths that had used that single attributedefinition. These declarations avoid the loss of the attribute when itis subsequently removed, because the attribute has been promoted in thecurrently analyzed branches. The declarations are subject to furtheroptimization when the related branches are optimized for the attribute.

The attribute is then removed with respect to all the originally foundattributes. Note that this optimization uses a local configurationanalysis and can be applied recursively.

This optimization serves to reduce the number of pushes and pops. Thisimproves the traversal time and the drawing time.

Promotion of attributes can be used to optimize a shader. When drawingan object, a set of states needs to be set to determine what kind ofshading will be applied to the geometry. These states include, forexample, the number of passes to draw and the blending functions to use.The set of states defines a shader. To accomplish shading, differentlists can be used addressing the passes and other attributes. Thesechoices depend on the capabilities of the rendering hardware.

When a list of geometries is drawn with the same shader, the cost ofchanging all these states is minimal. To draw several geometries withdifferent shaders, however, all the states have to be reset for each oneof shaders in the general case, because nothing is known about thecontext. However, in most cases not all the states need to be reset orchanged. The following is an application of the promotion of attributes,to optimize a shader by reducing the cost of the shader setup:

First, replace the abstract shader by the list of passes to be drawn andthe list of states (i.e. attributes) to be used for each pass. Forrendering hardware that uses several texture units, a single pass canuse several texture units.

Second, if calculation needs to be performed for one shader, then createan attribute to perform this operation. For example, shifting of thetexture coordinates in a bump map shader can be done by the shader whiletraversing the graph, or in a specific attribute before drawing thegeometry. Such separation has other benefits, like enabling theinstantiation of the shader in the graph.

Finally, promote all the attributes used by all the shaders. The resultis that if all the shaders are using the first texture unit, then therewill be only one enable of this unit overall, as opposed to one pershader. This enable can be shared for different shaders, and fordifferent passes of the same texture unit.

This operation can be done only when the capacities of the platform areknown. A shader will typically be implemented in different ways,depending on the rendering hardware. This operation can be done offline(and the optimized result saved) when the hardware is know.Alternatively, this can be done after the load time if the targetedhardware cannot be predicted.

J. Remove Attributes

This optimization removes attributes that are not needed in run time.Many modelers and exporters put attributes in an exported scene graph bydefault, so as to reflect as closely as possible the data in themodeler. Some of this information, however, is not used in run time.This optimization deletes such attributes.

Note that the time taken by stack operations in processing a scene graphdepends on the number of operations. Therefore, given 10 attributes for1000 geometries that are defined at lowest level leaf nodes, the resultis 10,000 stack operations. Hence, the elimination of attributes cansave considerable time both in traversal and in drawing. Moreover,because information has been removed from the scene graph, memory usageis improved.

K. Resize Image

In this optimization, the textures used in a scene can be saved in thescene graph file itself, instead of an external image file. It may bedesirable to scale down the size of all the textures of a given scenegraph file, so that there is no need (or a reduced need) to pagetextures. The resizing of the image can be done based on the size of thetexel. In the case where texture paging is still required, the imageloading time is reduced. In addition, memory usage is reduced since theimage is scaled down.

L. Share Attributes

When creating attributes in a scene graph, it is possible to havemultiple attributes that represent the same state all sharing the sameset of objects. A created texture state object, for example, can be usedat multiple points in a scene graph. This optimization makes sure thatany two attributes that represent the same state are sharing the sameobjects. This sharing of objects improves memory usage, and can alsoimprove run time efficiency, since a cache can use a pointer to theobject as an identifier.

M. Spatial Partition

This optimization improves the efficiency of the frustum cullingprocess. It minimizes the number of tests that must be applied byimproving the number of geometries culled at each test. This is done byorganizing the scene spatially in bi-trees, quad-trees, and oct-trees.Such an optimization may use more memory, but enhances the frustumculling traversal process.

N. Strip Triangles

This optimization recasts a scene graph so that a mesh presented to thegraphics hardware is in the form of triangle strips. A triangle strip isa series of adjacent triangles. Given a single initial triangle, a newadjacent triangle is created by defining a new point, such that the newtriangle is formed by the new point and two vertices of the previoustriangle. Successive triangles are then formed in this manner resultingin a triangle strip. Such a construction, in contrast to a set ofindependent triangles, leads to a reduction in memory usage, given thateach new triangle is effectively defined by a single point.

O. Transform Alpha

This optimization rescales alpha values in accordance with a specificrendering platform. This is useful given that different renderingplatforms can have different alpha ranges. In using this optimization, auser can specify an offset factor and a scale factor as parameters.

P. Vertex Blending

When using vertex blending, two parameters are relevant. First, thenumber of matrices for the complete mesh is relevant. Second the numberof matrices per vertex must be taken into account. Depending on therendering platform, these parameters may have upper bounds. To use ahardware accelerated vertex blending feature, therefore, the mesh mayhave to be split, regrouped, reindexed or some weight might bediscarded.

V. Conclusion

While various embodiments of the present invention have been describedabove, it should be understood that they have been presented by way ofexample, and not limitation. It will be apparent to persons skilled inthe relevant art that various changes in detail can be made thereinwithout departing from the spirit and scope of the invention. Thus, thepresent invention should not be limited by any of the above-describedexemplary embodiments, but should be defined only in accordance with thefollowing claims and their equivalents.

1. A system for optimization of a scene graph, comprising: anoptimization base comprising logic for at least one atomic optimization;an optimization registry listing said at least one atomic optimization,and further listing parameter and priority information associated withsaid at least one atomic optimization; an optimization manager forcreating, configuring, and applying an optimization process to an inputscene graph, wherein said optimization process comprises logic for anatomic optimization; and an optimization configuration manager foraccepting user configuration information to said optimization process,said user configuration information comprising selection of one or moreof said at least one atomic optimization.
 2. The system of claim 1,further comprising a user interface through which a user can providesaid user configuration information to said optimization configurationmanager.
 3. The system of claim 2, wherein said user interface isprovided to a user by a modeler that produces the scene graph to beoptimized.
 4. The system of claim 1, wherein said user configurationinformation comprises a specification of parameter values associatedwith said selected atomic optimization.
 5. The system of claim 1,wherein said at least one atomic optimization comprises a collapsegeometry optimization.
 6. The system of claim 1, wherein said at leastone atomic optimization comprises a collapse hierarchy optimization. 7.The system of claim 1, wherein said at least one atomic optimizationcomprises a convert image optimization.
 8. The system of claim 1,wherein said at least one atomic optimization comprises a converttransform optimization.
 9. The system of claim 1, wherein said at leastone atomic optimization comprises a create bounding boxes optimization.10. The system of claim 1, wherein said at least one atomic optimizationcomprises a flatten hierarchy optimization.
 11. The system of claim 1,wherein said at least one atomic optimization comprises a generate macrotexture optimization.
 12. The system of claim 1, wherein said at leastone atomic optimization comprises a normalize texture coordinatesoptimization.
 13. The system of claim 1, wherein said at least oneatomic optimization comprises a promote attributes optimization.
 14. Thesystem of claim 1, wherein said at least one atomic optimizationcomprises a remove attributes optimization.
 15. The system of claim 1,wherein said at least one atomic optimization comprises a resize imageoptimization.
 16. The system of claim 1, wherein said at least oneatomic optimization comprises a share attributes optimization.
 17. Thesystem of claim 1, wherein said at least one atomic optimizationcomprises a spatial partition optimization.
 18. The system of claim 1,wherein said at least one atomic optimization comprises a striptriangles optimization.
 19. The system of claim 1, wherein said at leastone atomic optimization comprises a transform alpha optimization. 20.The system of claim 1, wherein said at least one atomic optimizationcomprises a vertex blending optimization.
 21. A method of optimizationof a scene graph, comprising the steps of: a. receiving an input scenegraph; b. creating an optimization process; and c. applying theoptimization process to the input scene graph to create a scene graphoptimized for at least one of enhancement of traversal time, enhancementof drawing time, reduction of memory usage, efficiency of datamanipulation, and targeting a specific rendering platform, wherein saidstep b comprises the steps of: i. receiving user input identifying anatomic optimization and any associated parameters; ii. accessing theatomic optimization via an optimization registry; iii. incorporating theatomic optimization into the optimization process; iv. if the user inputcomprises parameters associated with the optimization, configuring theoptimization process according to the parameters; and v. if the userinput does not comprise parameters, configuring the optimization processaccording to default parameters.
 22. The method of claim 21, wherein theatomic optimization comprises a collapse geometry optimization.
 23. Themethod of claim 21, wherein the atomic optimization comprises a collapsehierarchy optimization.
 24. The method of claim 21, wherein the atomicoptimization comprises a convert image optimization.
 25. The method ofclaim 21, wherein the atomic optimization comprises a convert transformoptimization.
 26. The method of claim 21, wherein the atomicoptimization comprises a create bounding boxes optimization.
 27. Themethod of claim 21, wherein the atomic optimization comprises a flattenhierarchy optimization.
 28. The method of claim 21, wherein the atomicoptimization comprises a generate macro texture optimization.
 29. Themethod of claim 21, wherein the atomic optimization comprises anormalize texture coordinates optimization.
 30. The method of claim 21,wherein the atomic optimization comprises a promote attributesoptimization.
 31. The method of claim 21, wherein the atomicoptimization comprises a remove attributes optimization.
 32. The methodof claim 21, wherein the atomic optimization comprises a resize imageoptimization.
 33. The method of claim 21, wherein the atomicoptimization comprises a share attributes optimization.
 34. The methodof claim 21, wherein the atomic optimization comprises a spatialpartition optimization.
 35. The method of claim 21, wherein the atomicoptimization comprises a strip triangles optimization.
 36. The method ofclaim 21, wherein the atomic optimization comprises a transform alphaoptimization.
 37. The method of claim 21, wherein the atomicoptimization comprises a vertex blending optimization.
 38. The method ofclaim 21, further comprising the step of: d. performing postoptimization processing.
 39. The method of claim 21, further comprisingthe step of: d. outputting an optimized scene graph.
 40. A computerprogram product comprising a computer usable medium having computerreadable program code means embodied in said medium for causing anapplication program to execute on a computer that optimizes a scenegraph, said computer readable program code means comprising: a. computerreadable program code means for causing the computer to receive an inputscene graph; b. computer readable program code means for causing thecomputer to create an optimization process; and c. computer readableprogram code means for causing the computer to apply the optimizationprocess to the input scene graph to create a scene graph optimized forat least one of enhancement of traversal time, enhancement of drawingtime, reduction of memory usage, efficiency of data manipulation, andtargeting a specific rendering platform, wherein said computer readableprogram code means b comprises: i. computer readable program code meansfor causing the computer to receive user input identifying an atomicoptimization and any associated parameters; ii. computer readableprogram code means for causing the computer to access the atomicoptimization via an optimization registry; iii. computer readableprogram code means for causing the computer to incorporate the atomicoptimization into the optimization process; iv. computer readableprogram code means for causing the computer to configure theoptimization process according to the parameters, if the user inputcomprises parameters associated with the optimization; and v. computerreadable program code means for causing the computer to configure theoptimization process according to default parameters, if the user inputdoes not comprise parameters.
 41. The computer program product of claim40, wherein the atomic optimization comprises a collapse geometryoptimization.
 42. The computer program product of claim 40, wherein theatomic optimization comprises a collapse hierarchy optimization.
 43. Thecomputer program product of claim 40, wherein the atomic optimizationcomprises a convert image optimization.
 44. The computer program productof claim 40, wherein the atomic optimization comprises a converttransform optimization.
 45. The computer program product of claim 40,wherein the atomic optimization comprises a create bounding boxesoptimization.
 46. The computer program product of claim 40, wherein theatomic optimization comprises a flatten hierarchy optimization.
 47. Thecomputer program product of claim 40, wherein the atomic optimizationcomprises a generate macro texture optimization.
 48. The computerprogram product of claim 40, wherein the atomic optimization comprises anormalize texture coordinates optimization.
 49. The computer programproduct of claim 40, wherein the atomic optimization comprises a promoteattributes optimization.
 50. The computer program product of claim 40,wherein the atomic optimization comprises a remove attributesoptimization.
 51. The computer program product of claim 40, wherein theatomic optimization comprises a resize image optimization.
 52. Thecomputer program product of claim 40, wherein the atomic optimizationcomprises a share attributes optimization.
 53. The computer programproduct of claim 40, wherein the atomic optimization comprises a spatialpartition optimization.
 54. The computer program product of claim 40,wherein the atomic optimization comprises a strip trianglesoptimization.
 55. The computer program product of claim 40, wherein theatomic optimization comprises a transform alpha optimization.
 56. Thecomputer program product of claim 40, wherein the atomic optimizationcomprises a vertex blending optimization.
 57. The computer programproduct of claim 40, further comprising: d. computer readable programcode means for causing the computer to perform post optimizationprocessing.
 58. The computer program product of claim 40, furthercomprising: d. computer readable program code means for causing thecomputer to output an optimized scene graph.
 59. A method ofoptimization of a scene graph, comprising the steps of: a. receiving aninput scene graph; b. creating an optimization process; c. applying theoptimization process to the input scene graph to create a scene graphoptimized for at least one of enhancement of traversal time, enhancementof drawing time, reduction of memory usage, efficiency of datamanipulation, and targeting a specific rendering platform; and d.performing post optimization processing, wherein said step d comprisesthe steps of: i. performing validity checks on the optimized scenegraph; ii. creating statistics based on the optimization process; andiii. outputting the statistics.
 60. A computer program productcomprising a computer usable medium having computer readable programcode means embodied in said medium for causing an application program toexecute on a computer that optimizes a scene graph, said computerreadable program code means comprising: first computer readable programcode means for causing the computer to receive an input scene graph;second computer readable program code means for causing the computer tocreate an optimization process; and third computer readable program codemeans for causing the computer to apply the optimization process to theinput scene graph to create a scene graph optimized for at least one ofenhancement of traversal time, enhancement of drawing time, reduction ofmemory usage, efficiency of data manipulation, and targeting a specificrendering platform; and fourth computer readable program code means forcausing the computer to perform post optimization processing whereinsaid fourth computer readable program code means comprises: i. computerreadable program code means for causing the computer to perform validitychecks on the optimized scene graph; ii. computer readable program codemeans for causing the computer to create statistics based on theoptimization process; and iii. computer readable program code means forcausing the computer to output the statistics.